package cate.game.fight.hero.dyn;

import cate.common.table.dynins.DynHeroLevelRow;
import cate.common.table.item.hero.row.HeroBaseRow;
import cate.game.play.support.PlayBuildContext;
import cate.game.play.support.PlayBuildContextWith;
import cate.game.role.bag.hero.Hero;
import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteClass;


@NoteClass("动态英雄util")
public class DynHeroUtil extends PlayBuildContextWith {

	private DynEquipUtil equip = new DynEquipUtil();
	private DynGemUtil gem = new DynGemUtil();
	private DynRuneUtil rune = new DynRuneUtil();
	private DynSpiceUtil spice = new DynSpiceUtil();
	private DynTalentUtil talent = new DynTalentUtil();
	private DynFurnitureUtil furniture = new DynFurnitureUtil();
	private DynFavorableUtil favorable = new DynFavorableUtil();


	@JsonIgnore
	private DynItemUtil[] getUtils() {
		return new DynItemUtil[]{equip, gem, rune, spice, talent, furniture,favorable};
	}


	@Override
	public void init(PlayBuildContext ctx) throws Exception {
		super.init(ctx);
		for (DynItemUtil item : getUtils()) {
			item.init(ctx);
		}
	}

	public void setUp(Hero hero, HeroBaseRow heroTpl, DynHeroLevelRow itemTpl) {
		for (DynItemUtil item : getUtils()) {
			item.setUp(hero, heroTpl, itemTpl);
		}
	}

}
